/**
 * Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.cms.column.mapper;

import com.jeeplus.core.persistence.TreeMapper;
import com.jeeplus.modules.cms.column.entity.CmsColumn;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 栏目MAPPER接口
 *
 * @author Sawyer
 * @version 2020-11-21
 */
@Mapper
@Repository
public interface CmsColumnMapper extends TreeMapper<CmsColumn> {

    /**
     * 点击数+1
     *
     * @param id id
     * @return 受影响记录数
     */
    int updateHitsAddOne(String id);

    /**
     * 根据主键集合获取栏目对象
     *
     * @param primaryKeyList 主键集合
     * @return list
     */
    List<CmsColumn> findColumnByPrimaryKeys(List<String> primaryKeyList);

    /**
     * 根据siteId获取总点击数
     *
     * @param siteId 站点id
     * @return 总点击数
     */
    Integer getTotalHitsBySiteId(String siteId);
}
